<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="org.limp.basework.console.XSystemConfig"%>
<%
    String context = jt.classic.system.ISystem.getContextPath();

    String homePage = (String)XSystemConfig.config().getProperty(XSystemConfig.XSYSTEM_HOMEPAGE);
   
    String ip = request.getRemoteAddr();
%>  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> 
<html> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
<title>朝阳全模式社会服务系统-信访</title> 
<jsp:include page="../system/head4nosession.jsp"></jsp:include>
<link href="<%=context %>/newframe/images/skin.css" rel="stylesheet" type="text/css"></link>
<style type="text/css"> 
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #1D3647;
}
</style> 
<script>
    var HOMEPAGE = '<%=homePage%>';

    function loginSystem(){
        var but = Ext.get('submit').dom;
        
        but.disabled = true;
    
        Ext.MessageBox.wait('登录验证过程中...');
        var logid = Ext.get('logid').dom.value;
		var password = Ext.get('pwd').dom.value;
		setParam2XML("logid", logid);
		setParam2XML("pwd", password);

		Ext.Ajax.request({
					url : context + '/system/staticlogin.do',
					method : 'POST',
					async : false,
					xmlData : getParam2XML(),
					success : function(response, options) {
						var o = Ext.util.JSON
								.decode(response.responseText);
						if (!o.success) {
							Ext.MessageBox.hide();
							if (o.errCode == "-2") {
								Ext.Msg
										.alert('错误',
												'错误的用户名或密码');
								but.disabled = false;
							} else if (o.errCode == "-3") {
								Ext.Msg
										.alert('错误',
												'您使用的帐号已失效，请联系管理员重新启用该帐号');
								but.setText("登录");
								but.disabled = false;
							} else {
								Ext.Msg
										.alert('错误',
												'未知的错误异常，请稍后再试或联系系统管理员');
								but.disabled = false;
							}
						} else {
							Ext.MessageBox.hide();
							document.location = context + HOMEPAGE;
						}
					}
				});
    }
</script>
</head> 
<body>
<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
      <td height="42" class="login_top_bg">&nbsp;</td>
   </tr>
   <tr>
      <td height="532" class="login_bg">
	      <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
	         <tr>
	            <td width="50%">&nbsp;</td>
	            <td width="50%">
	               <div style="margin:10px;">
	               <span class="login_txt">管理员：&nbsp;&nbsp;</span>
	               <input id="logid" name="logid" type="text" class="editbox4" value="" style="width:150px;">
	               </div>
	               <div style="margin:10px;">
	               <span class="login_txt">密&nbsp;&nbsp;&nbsp;&nbsp;码：&nbsp;&nbsp;</span>
	               <input id="pwd" name="pwd" type="password" class="editbox4" value="" style="width:150px;">
	               </div>
	               <div style="margin:10px;">
	               <input name="submit" id="submit" type="button" class="button" id="Submit" value="登 录" onclick="javascript:loginSystem();">
	               <input name="reset" type="reset" class="button" id="cs" value="取 消">
	               </div>
	            </td>
	         </tr>
	      </table>
      </td>
   </tr>
   <tr>
       <td height="20" class="login-buttom-bg">&nbsp;</td>
   </tr>
</table>
</body>
</html> 